/*
 * SEMIDRIVE Copyright Statement
 * Copyright (c) SEMIDRIVE. All rights reserved
 *
 * This software and all rights therein are owned by SEMIDRIVE, and are
 * protected by copyright law and other relevant laws, regulations and
 * protection. Without SEMIDRIVE's prior written consent and/or related rights,
 * please do not use this software or any potion thereof in any form or by any
 * means. You may not reproduce, modify or distribute this software except in
 * compliance with the License. Unless required by applicable law or agreed to
 * in writing, software distributed under the License is distributed on
 * an "AS IS" basis, WITHOUT WARRANTIES OF ANY KIND, either express or implied.
 *
 * You should have received a copy of the License along with this program.
 * If not, see <http://www.semidrive.com/licenses/>.
 */

/**
 * @file  Can_PBCfg.c
 * @brief Semidrive. AUTOSAR 4.3.1 MCAL Can Driver.
 * @date 2025-06-04 10:43:19
 */
#ifdef __cplusplus
extern "C" {
#endif

#include "Can.h"

/* Version and Check Begin */
/* Version Info Begin */
#define CAN_PBCFG_C_VENDOR_ID    0x8C
#define CAN_PBCFG_C_AR_RELEASE_MAJOR_VERSION    4
#define CAN_PBCFG_C_AR_RELEASE_MINOR_VERSION    3
#define CAN_PBCFG_C_AR_RELEASE_REVISION_VERSION 1
#define CAN_PBCFG_C_SW_MAJOR_VERSION    1
#define CAN_PBCFG_C_SW_MINOR_VERSION    0
#define CAN_PBCFG_C_SW_PATCH_VERSION    0
/* Version Info End */
/* Version and Check End */
/*PRQA S 1751  EOF*/

#define CAN_START_SEC_VAR_NO_INIT_UNSPECIFIED
#include "Can_MemMap.h"
#define CAN_STOP_SEC_VAR_NO_INIT_UNSPECIFIED
#include "Can_MemMap.h"

#define CAN_START_SEC_CONST_UNSPECIFIED
#include "Can_MemMap.h"
/* CAN controller ID 0 baud rate configurations. */
static const VAR(Can_BaudRateConfigType, CAN_VAR) Can0_BaudRateConfig[] = {
    {   /* Config0 */
        0U, /* baudRateConfigId */
        1U, /* extendBitTimingFormat */
        0U, /* enhancedBitTimingFormat */
        {
            4U, /* prescaler */
            10U, /* propSeg */
            19U, /* phaseSeg1 */
            10U, /* phaseSeg2 */
            4U, /* resyncJumpWidth */
        },
        {   /* fdConfig */
            1U | (1U << 1) | (1U << 2),
            8U,  /* tdcOffset */
            {
                4U, /* prescaler */
                3U, /* propSeg */
                4U, /* phaseSeg1 */
                2U, /* phaseSeg2 */
                1U, /* resyncJumpWidth */
            },
        }
    },  /*CAN FD ON, arbitration baud rate: 500kbps, data baud rate: 2000kbps*/

};

/* CAN controller ID 1 baud rate configurations. */
static const VAR(Can_BaudRateConfigType, CAN_VAR) Can1_BaudRateConfig[] = {
    {   /* Config0 */
        0U, /* baudRateConfigId */
        1U, /* extendBitTimingFormat */
        0U, /* enhancedBitTimingFormat */
        {
            4U, /* prescaler */
            10U, /* propSeg */
            19U, /* phaseSeg1 */
            10U, /* phaseSeg2 */
            4U, /* resyncJumpWidth */
        },
        {   /* fdConfig */
            1U | (1U << 1) | (1U << 2),
            8U,  /* tdcOffset */
            {
                4U, /* prescaler */
                3U, /* propSeg */
                4U, /* phaseSeg1 */
                2U, /* phaseSeg2 */
                1U, /* resyncJumpWidth */
            },
        }
    },  /*CAN FD ON, arbitration baud rate: 500kbps, data baud rate: 2000kbps*/

};


/* Controllers configuration. */
static const VAR(Can_ControllerConfigType, CAN_VAR) Can_ControllerConfig[] = {
    {   /* Controllre ID 0 */
        (boolean)TRUE,   /* Contoller is used=1 or not_used=0*/
        0xf8500000U,  /* baseAddr */
        MIXED,  /* rxProcType */
        MIXED,  /* txProcType */
        INTERRUPT,  /* busoffProcType */
        INTERRUPT,  /* wakeupProcType */
        0U,  /* controllerId */
        53U,  /* maxMBNum */
        (1U << 4) | (1U << 5), /* option */
        0U,   /* defaultBaudRateId */
        1U,  /* baudRateConfigCount */
        Can0_BaudRateConfig, /* baudRateConfig */
        (0U << 16) | (3U << 19) | (3U << 22) | (3U << 25),    /* mbdsrVal */
        RX_FIFO_FILTER_TYPE_A,    /* rxFifoFilterTableFormat */
        MB_PRIORITY_HIGH, /* mbPriority */
        (Can_CoreIdType)1U, /* Core ID: 0:Core0 1:Core1 2:Core2 3:Core3 */
    },

    {   /* Controllre ID 1 */
        (boolean)TRUE,   /* Contoller is used=1 or not_used=0*/
        0xf0580000U,  /* baseAddr */
        MIXED,  /* rxProcType */
        MIXED,  /* txProcType */
        INTERRUPT,  /* busoffProcType */
        INTERRUPT,  /* wakeupProcType */
        1U,  /* controllerId */
        53U,  /* maxMBNum */
        (1U << 4) | (1U << 5), /* option */
        0U,   /* defaultBaudRateId */
        1U,  /* baudRateConfigCount */
        Can1_BaudRateConfig, /* baudRateConfig */
        (0U << 16) | (3U << 19) | (3U << 22) | (3U << 25),    /* mbdsrVal */
        RX_FIFO_FILTER_TYPE_A,    /* rxFifoFilterTableFormat */
        MB_PRIORITY_HIGH, /* mbPriority */
        (Can_CoreIdType)0U, /* Core ID: 0:Core0 1:Core1 2:Core2 3:Core3 */
    },

};



/* MB configuration. */
static const VAR(Can_MBConfigType, CAN_VAR) Can_MBConfig[] = {
    {   /* Host_SYNCTime_500ms */
        CAN_ID_STANDARD, /* idType */
        RECEIVE,    /* hohType */
        4U,  /* canObjId */
        1U,  /* controllerId */
        39U,   /* mbId */
        64U,  /* payloadSize */
        0U, /* fdPaddingVal */
        FALSE,    /* usePolling */
        0x9eU,   /* filterCode */
        0xFFFFFFFFU,  /* filterMask */
    },

    {   /* Host_TransMsg1_20ms */
        CAN_ID_STANDARD, /* idType */
        RECEIVE,    /* hohType */
        5U,  /* canObjId */
        1U,  /* controllerId */
        40U,   /* mbId */
        64U,  /* payloadSize */
        0U, /* fdPaddingVal */
        FALSE,    /* usePolling */
        0x299U,   /* filterCode */
        0xFFFFFFFFU,  /* filterMask */
    },

    {   /* Rout_Can1ToCan2_100ms */
        CAN_ID_STANDARD, /* idType */
        RECEIVE,    /* hohType */
        6U,  /* canObjId */
        1U,  /* controllerId */
        41U,   /* mbId */
        64U,  /* payloadSize */
        0U, /* fdPaddingVal */
        FALSE,    /* usePolling */
        0x569U,   /* filterCode */
        0xFFFFFFFFU,  /* filterMask */
    },

    {   /* XCP_Req */
        CAN_ID_STANDARD, /* idType */
        RECEIVE,    /* hohType */
        7U,  /* canObjId */
        1U,  /* controllerId */
        32U,   /* mbId */
        64U,  /* payloadSize */
        0U, /* fdPaddingVal */
        FALSE,    /* usePolling */
        0x703U,   /* filterCode */
        0xFFFFFFFFU,  /* filterMask */
    },

    {   /* Host_TransMsg2_20ms */
        CAN_ID_STANDARD, /* idType */
        RECEIVE,    /* hohType */
        8U,  /* canObjId */
        1U,  /* controllerId */
        42U,   /* mbId */
        64U,  /* payloadSize */
        0U, /* fdPaddingVal */
        FALSE,    /* usePolling */
        0x39aU,   /* filterCode */
        0xFFFFFFFFU,  /* filterMask */
    },

    {   /* Host_CAN1_NM */
        CAN_ID_STANDARD, /* idType */
        RECEIVE,    /* hohType */
        9U,  /* canObjId */
        1U,  /* controllerId */
        0U,   /* mbId */
        8U,  /* payloadSize */
        0U, /* fdPaddingVal */
        FALSE,    /* usePolling */
        0x400U,   /* filterCode */
        (0x700U << 18) | 0xC0000000U | 0x3FFFFU,  /* filterMask */
    },

    {   /* UDS_DiagFuncReq */
        CAN_ID_STANDARD, /* idType */
        RECEIVE,    /* hohType */
        10U,  /* canObjId */
        1U,  /* controllerId */
        33U,   /* mbId */
        64U,  /* payloadSize */
        0U, /* fdPaddingVal */
        FALSE,    /* usePolling */
        0x7dfU,   /* filterCode */
        0xFFFFFFFFU,  /* filterMask */
    },

    {   /* UDS_DiagPhyReq */
        CAN_ID_STANDARD, /* idType */
        RECEIVE,    /* hohType */
        11U,  /* canObjId */
        1U,  /* controllerId */
        34U,   /* mbId */
        64U,  /* payloadSize */
        0U, /* fdPaddingVal */
        FALSE,    /* usePolling */
        0x7e1U,   /* filterCode */
        0xFFFFFFFFU,  /* filterMask */
    },

    {   /* EcuDemo_SYNCTime_500ms */
        CAN_ID_STANDARD, /* idType */
        TRANSMIT,    /* hohType */
        17U,  /* canObjId */
        1U,  /* controllerId */
        35U,   /* mbId */
        64U,  /* payloadSize */
        0U, /* fdPaddingVal */
        FALSE,    /* usePolling */
        0U,   /* filterCode */
        0U,   /* filterMask */
    },

    {   /* EcuDemo_TransMsg2_100ms */
        CAN_ID_STANDARD, /* idType */
        TRANSMIT,    /* hohType */
        18U,  /* canObjId */
        1U,  /* controllerId */
        36U,   /* mbId */
        64U,  /* payloadSize */
        0U, /* fdPaddingVal */
        FALSE,    /* usePolling */
        0U,   /* filterCode */
        0U,   /* filterMask */
    },

    {   /* EcuDemo_CAN1_NM */
        CAN_ID_STANDARD, /* idType */
        TRANSMIT,    /* hohType */
        19U,  /* canObjId */
        1U,  /* controllerId */
        1U,   /* mbId */
        8U,  /* payloadSize */
        0U, /* fdPaddingVal */
        FALSE,    /* usePolling */
        0U,   /* filterCode */
        0U,   /* filterMask */
    },

    {   /* EcuDemo_TransMsg3_Event */
        CAN_ID_STANDARD, /* idType */
        TRANSMIT,    /* hohType */
        20U,  /* canObjId */
        1U,  /* controllerId */
        2U,   /* mbId */
        8U,  /* payloadSize */
        0U, /* fdPaddingVal */
        FALSE,    /* usePolling */
        0U,   /* filterCode */
        0U,   /* filterMask */
    },

    {   /* XCP_Resp */
        CAN_ID_STANDARD, /* idType */
        TRANSMIT,    /* hohType */
        21U,  /* canObjId */
        1U,  /* controllerId */
        37U,   /* mbId */
        64U,  /* payloadSize */
        0U, /* fdPaddingVal */
        FALSE,    /* usePolling */
        0U,   /* filterCode */
        0U,   /* filterMask */
    },

    {   /* EcuDemo_TransMsg1_10ms */
        CAN_ID_STANDARD, /* idType */
        TRANSMIT,    /* hohType */
        22U,  /* canObjId */
        1U,  /* controllerId */
        38U,   /* mbId */
        64U,  /* payloadSize */
        0U, /* fdPaddingVal */
        FALSE,    /* usePolling */
        0U,   /* filterCode */
        0U,   /* filterMask */
    },

    {   /* Rout_Can2ToCan1_100ms */
        CAN_ID_STANDARD, /* idType */
        TRANSMIT,    /* hohType */
        23U,  /* canObjId */
        1U,  /* controllerId */
        43U,   /* mbId */
        64U,  /* payloadSize */
        0U, /* fdPaddingVal */
        FALSE,    /* usePolling */
        0U,   /* filterCode */
        0U,   /* filterMask */
    },

    {   /* UDS_DiagResp */
        CAN_ID_STANDARD, /* idType */
        TRANSMIT,    /* hohType */
        24U,  /* canObjId */
        1U,  /* controllerId */
        44U,   /* mbId */
        64U,  /* payloadSize */
        0U, /* fdPaddingVal */
        FALSE,    /* usePolling */
        0U,   /* filterCode */
        0U,   /* filterMask */
    },

    {   /* Rout_Can2ToCan1_100ms_CAN2 */
        CAN_ID_STANDARD, /* idType */
        RECEIVE,    /* hohType */
        0U,  /* canObjId */
        0U,  /* controllerId */
        39U,   /* mbId */
        64U,  /* payloadSize */
        0U, /* fdPaddingVal */
        FALSE,    /* usePolling */
        0x3adU,   /* filterCode */
        0xFFFFFFFFU,  /* filterMask */
    },

    {   /* Host_CAN2_NM */
        CAN_ID_STANDARD, /* idType */
        RECEIVE,    /* hohType */
        1U,  /* canObjId */
        0U,  /* controllerId */
        0U,   /* mbId */
        8U,  /* payloadSize */
        0U, /* fdPaddingVal */
        FALSE,    /* usePolling */
        0x400U,   /* filterCode */
        (0x700U << 18) | 0xC0000000U | 0x3FFFFU,  /* filterMask */
    },

    {   /* Host_TransMsg2_20ms_CAN2 */
        CAN_ID_STANDARD, /* idType */
        RECEIVE,    /* hohType */
        2U,  /* canObjId */
        0U,  /* controllerId */
        40U,   /* mbId */
        64U,  /* payloadSize */
        0U, /* fdPaddingVal */
        FALSE,    /* usePolling */
        0x3a0U,   /* filterCode */
        0xFFFFFFFFU,  /* filterMask */
    },

    {   /* Host_TransMsg1_20ms_CAN2 */
        CAN_ID_STANDARD, /* idType */
        RECEIVE,    /* hohType */
        3U,  /* canObjId */
        0U,  /* controllerId */
        32U,   /* mbId */
        64U,  /* payloadSize */
        0U, /* fdPaddingVal */
        FALSE,    /* usePolling */
        0x100U,   /* filterCode */
        0xFFFFFFFFU,  /* filterMask */
    },

    {   /* Rout_Can1ToCan2_100ms_CAN2 */
        CAN_ID_STANDARD, /* idType */
        TRANSMIT,    /* hohType */
        12U,  /* canObjId */
        0U,  /* controllerId */
        33U,   /* mbId */
        64U,  /* payloadSize */
        0U, /* fdPaddingVal */
        FALSE,    /* usePolling */
        0U,   /* filterCode */
        0U,   /* filterMask */
    },

    {   /* EcuDemo_TransMsg1_10ms_CAN2 */
        CAN_ID_STANDARD, /* idType */
        TRANSMIT,    /* hohType */
        13U,  /* canObjId */
        0U,  /* controllerId */
        34U,   /* mbId */
        64U,  /* payloadSize */
        0U, /* fdPaddingVal */
        FALSE,    /* usePolling */
        0U,   /* filterCode */
        0U,   /* filterMask */
    },

    {   /* EcuDemo_TransMsg2_100ms_CAN2 */
        CAN_ID_STANDARD, /* idType */
        TRANSMIT,    /* hohType */
        14U,  /* canObjId */
        0U,  /* controllerId */
        35U,   /* mbId */
        64U,  /* payloadSize */
        0U, /* fdPaddingVal */
        FALSE,    /* usePolling */
        0U,   /* filterCode */
        0U,   /* filterMask */
    },

    {   /* EcuDemo_TransMsg3_Event_CAN2 */
        CAN_ID_STANDARD, /* idType */
        TRANSMIT,    /* hohType */
        15U,  /* canObjId */
        0U,  /* controllerId */
        36U,   /* mbId */
        64U,  /* payloadSize */
        0U, /* fdPaddingVal */
        FALSE,    /* usePolling */
        0U,   /* filterCode */
        0U,   /* filterMask */
    },

    {   /* EcuDemo_CAN2_NM */
        CAN_ID_STANDARD, /* idType */
        TRANSMIT,    /* hohType */
        16U,  /* canObjId */
        0U,  /* controllerId */
        1U,   /* mbId */
        8U,  /* payloadSize */
        0U, /* fdPaddingVal */
        FALSE,    /* usePolling */
        0U,   /* filterCode */
        0U,   /* filterMask */
    },

};



/* CAN configuration. */
CONST(Can_ConfigType, CAN_VAR) Can_Config = {
    Can_ControllerConfig,
    Can_MBConfig,
    NULL_PTR,
    CAN_MB_COUNT,
    NULL_PTR,
};
#define CAN_STOP_SEC_CONST_UNSPECIFIED
#include "Can_MemMap.h"


#ifdef __cplusplus
}
#endif
